﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/SiteAdmin.Master" AutoEventWireup="true" CodeBehind="ht_qlsp.aspx.cs" Inherits="Andy.Web.admin.ht_qlsp" EnableEventValidation="false" %>

<%@ Register TagPrefix="obout" Namespace="Vdc.Grid" Assembly="vdc_Grid_NET" %>
<%@ Register Assembly="vdc_AJAXPage" Namespace="VdcInc" TagPrefix="vajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function XoaSanPham(id) {
            var answer = confirm("Bạn có chắc muốn xóa sản phẩm này ko ?")
            if (answer) {
                ob_post.AddParam('strSanPhamId', id);
                ob_post.post(null, "vXoaSanPham", ResultXoaSanPham);
            }
        }
        function ResultXoaSanPham(result, ex) {
            alert(result);
            location.reload();
        }
        function setValue()
        {
            var valueNam = $("select[id$='ddlDanhMuc'] option:selected").val();
            $("input[id$='hdfValue_DanhMuc']").val(valueNam);
            return true;

        }
    </script>
    <div id="page">
        <div class="inner">
            <div class="section table_section">
                <!--[if !IE]>start title wrapper<![endif]-->
                <div class="title_wrapper">
                    <h2>Danh sách sản phẩm</h2>
                    <ul class="section_menu">
                        <li><a class="active" href="#"><span><span>Quản lý sản phẩm</span></span></a></li>
                        <li><a href="ht_sxsp.aspx"><span><span>Sắp xếp sản phẩm</span></span></a></li>
                        <li><a href="ht_themsp.aspx"><span><span>Thêm mới sản phẩm</span></span></a></li>
                    </ul>
                    <span class="title_wrapper_left"></span><span class="title_wrapper_right"></span>
                </div>
                <!--[if !IE]>end title wrapper<![endif]-->
                <!--[if !IE]>start section content<![endif]-->
                <div class="section_content">
                    <!--[if !IE]>start section content top<![endif]-->
                    <div class="sct">
                        <div class="sct_left">
                            <div class="sct_right">
                                <div class="sct_left">
                                    <div class="sct_right">

                                        <fieldset>
                                            <!--[if !IE]>start table_wrapper<![endif]-->
                                            <div class="table_wrapper">
                                                <div class="table_wrapper_inner">
                                                    <div style="border-bottom: 1px solid #D3E5ED; padding-left: 10px; height: 40px; padding-top: 15px">
                                                        <p style="float: left">
                                                            Từ khoá :
                                                        <%--<input name="ctl00$ContentPlaceHolder1$ctl00$txtTuKhoa" id="ctl00_ContentPlaceHolder1_ctl00_txtTuKhoa"  type="text">--%>
                                                            <asp:TextBox runat="server" ID="txtTuKhoa" style="font-family: Arial; font-size: Small; width: 150px;"></asp:TextBox>
                                                            &nbsp;&nbsp;&nbsp; Danh mục :
                                                        <asp:DropDownList runat="server" ID="ddlDanhMuc"></asp:DropDownList>
                                                            <asp:HiddenField runat="server" ID="hdfValue_DanhMuc" />
                                                        </p>
                                                        <p style="float: left; margin-left: 15px;">
                                                            <%--<span class="button orange_btn"><span><span>Xem</span></span><input name="ctl00$ContentPlaceHolder1$ctl00$btnXem" value="Button" id="ctl00_ContentPlaceHolder1_ctl00_btnXem" type="submit"></span>--%>
                                                            <asp:Button runat="server" ID="btTimKiem" Text="Xem" OnClick="btTimKiem_Click" OnClientClick="return setValue();" />
                                                        </p>
                                                    </div>

                                                </div>
                                            </div>
                                            <!--[if !IE]>end table_wrapper<![endif]-->
                                            <!--[if !IE]>start table menu<![endif]-->
                                            <%--<div class="table_menu">
                                                <ul class="left">
                                                    <li><a href="http://kremlin.vn/Admin/Default.aspx?act=man-add-sanpham&amp;tab=5&amp;lang=vn" class="button add_new"><span><span>THÊM MỚI</span></span></a></li>
                                                </ul>
                                            </div>--%>
                                            <!--[if !IE]>end table menu<![endif]-->
                                        </fieldset>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--[if !IE]>end section content top<![endif]-->
                    <!--[if !IE]>start section content bottom<![endif]-->
                    <%--<span class="scb"><span class="scb_left"></span><span class="scb_right"></span></span>--%>
                    <!--[if !IE]>end section content bottom<![endif]-->
                </div>
                <div class="grid">
                    <obout:Grid ID="grid1" runat="server" CallbackMode="true" Serialize="true" AllowAddingRecords="true" PageSize="10"
                        FolderStyle="~/styles/premiere_blue" AutoGenerateColumns="false" AllowRecordSelection="false" AllowMultiRecordSelection="false" Width="100%"
                        ShowFooter="true" AllowSorting="false" AllowPaging="true" AllowPageSizeSelection="false" OnRowDataBound="grid1_RowDataBound">
                        <PagingSettings ShowRecordsCount="false" />
                        <TemplateSettings NewRecord_TemplateId="ButtonsTemplate" />
                        <Columns>
                            <obout:Column ID="Column1" DataField="CheckNoiBat" ReadOnly="true" HeaderText="Nổi bật" runat="server">
                                <TemplateSettings TemplateId="TemplateWithCheckbox" />
                            </obout:Column>
                            <obout:Column ID="Column2" DataField="Id" HeaderText="ID" runat="server" Visible="false" />
                            <obout:Column ID="Column3" DataField="Ten" HeaderText="Mã" runat="server" />
                            <obout:Column ID="Column5" DataField="Gia" HeaderText="Giá" runat="server" >
                                    <TemplateSettings TemplateId="numberTemplate" />
                            </obout:Column>
                            <obout:Column ID="Column4" DataField="TenLoai" HeaderText="Nhóm" runat="server" />
                            <obout:Column DataField="Anh" HeaderText="Ảnh">
                                <TemplateSettings TemplateId="ImageSanPham" />
                            </obout:Column>
                            <obout:Column HeaderText="">
                                <TemplateSettings TemplateId="Actions" />
                            </obout:Column>
                        </Columns>
                        <Templates>
                            <obout:GridTemplate runat="server" ID="ImageSanPham">
                                <Template>
                                        <img src="../<%# Container.DataItem["Anh"] %>" width="100" height="100" title="" alt="" />
                                    </Template>
                            </obout:GridTemplate>
                            <obout:GridTemplate runat="server" ID="Actions">
                                <Template>
                                    <a href="ht_suasp.aspx?idloai=<%# Container.DataItem["Id"] %>" class=""><img src="a_files/layout/site/tables/edit_action.gif" /></a>
                                    <a href="#null" onclick="XoaSanPham(<%# Container.DataItem["Id"] %>);" class=""><img src="a_files/layout/site/tables/action4.gif" /></a>
                                   </Template>
                                </obout:GridTemplate>
                            <obout:GridTemplate runat="server" ID="TemplateWithCheckbox">
                                <Template>
                                    <asp:CheckBox runat="server" ID="ChkID" ToolTip="<%# Container.Value %>" Checked="<%# Convert.ToBoolean(Container.Value) %>" />
                                    <asp:HiddenField runat="server" ID="ProductName" Value='<%# Container.DataItem["Id"] %>' />
                                </Template>
                            </obout:GridTemplate>
                            <obout:GridTemplate runat="server" ID="ButtonsTemplate">
                                <Template>
                                    <asp:Button ID="VdcButton1" runat="server" Text="Cập nhật" OnClick="VdcButton1_Click1"></asp:Button>
                                </Template>
                            </obout:GridTemplate>
                            <obout:GridTemplate runat="server" ID="numberTemplate">
						        <Template>
							        <%# Container.Value != String.Empty && Container.Value != "&#160;" ?  ("#,###;-#,###;0" == "{0:n:1}")? 
							        String.Format( "#,###;-#,###;0", Container.Value + "") : Convert.ToDecimal( Container.Value).ToString( "#,###;-#,###;0" )   : ""%>
						        </Template>
					        </obout:GridTemplate>
                        </Templates>
                    </obout:Grid>
                </div>
                <div class="section_content">
                    <!--[if !IE]>start section content top<![endif]-->
                    <div class="sct">
                        <div class="sct_left">
                            <div class="sct_right">
                                <div class="sct_left">
                                    <div class="sct_right">
                                        <fieldset>
                                            <!--[if !IE]>start table_wrapper<![endif]-->
                                            <div class="table_wrapper">
                                                <div class="table_wrapper_inner">
                                                    <div>
                                                        <table id="ctl00_ContentPlaceHolder1_ctl00_grvData" style="border-style: None; width: 100%; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td colspan="8">
                                                                        <ul class="pagesht clearfix">
                                                                            <asp:Literal ID="ltlPhanTrang" runat="server"></asp:Literal>
                                                                        </ul>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--[if !IE]>end section content<![endif]-->
            </div>

        </div>

    </div>

</asp:Content>
